﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcmyjobs.Web.enprise
{
    public partial class RegisterEnterprise : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Application["webname"] != null)
            {
                this.Title = string.Format("单位会员注册：单位信息&bull;联系方式  {0}", Application["webname"].ToString());
            }
        }

        protected void btn_save_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                lcmyjobs.BLL.enterprise_basic bm = new BLL.enterprise_basic();

                //string enterprise_bh = this.txtenterprise_bh.Text;
                string login = this.txtlogin.Text;
                string pwd = this.txtpwd.Text;
                pwd = myPublic.GetMd5(pwd);
                string name = this.txtname.Text;
                //int areas_id = int.Parse(this.txtareas_id.Text);
                string dwxz = this.ddl_dwxz.SelectedItem.Value;
                string dwgm = this.ddldwgm.SelectedItem.Value;//单位规模
                string clnf = this.txtclnf.Text;
                string lxr = this.txtlxr.Text;
                string telephone = this.txttelephone.Text;
                string email = this.txtemail.Text;
                //string fax = this.txtfax.Text;
                string fax = "";
                string mobilephone = this.txtmobilephone.Text;
                string website = this.txtwebsite.Text;
                string place = this.txtaddress.Text;
                string address = this.txtaddress.Text;
                string interviewadd = this.txtaddress.Text;
                //string about = this.txtabout.Text;
                bool isemp = true;//是否在招聘中1、是
                bool ispub = true;//资料是否公开1、是
                DateTime lastlogin = DateTime.Now;//上次登录时间
                int logincount = 0;//登录次数
                //string isshowlink = this.txtisshowlink.Text;//联系方式
                int enterprise_mid = 0;//会员级别，默认试用会员
                int bcount = 0;//浏览次数
                //DateTime membertime = DateTime.Now;//会员到期时间 注册时不填
                bool issubsrciption = true;//人才订阅 默认为0，订阅
                int status = 0;//审核状态，默认为0，未审核
                string areaname = this.txthuji.Text;//所属地区名
                int atid = int.Parse(Application["webid"].ToString());//注册网站

                string[] hys = this.txttrade.Text.Split(',');//行业
                string tradename1 = "0";
                string tradename2 = "0";
                string tradename3 = "0";
                if (hys.Length == 0)
                {
                    tradename1 = this.txttrade.Text;

                }
                if (hys.Length == 1)
                {
                    tradename1 = hys[0];
                }
                if (hys.Length == 2)
                {
                    tradename1 = hys[0];
                    tradename2 = hys[1];
                }
                if (hys.Length == 3)
                {
                    tradename1 = hys[0];
                    tradename2 = hys[1];
                    tradename3 = hys[2];
                }


                lcmyjobs.Model.enterprise_basic model = new lcmyjobs.Model.enterprise_basic();
                //model.enterprise_bh = enterprise_bh;
                model.login = login;
                model.pwd = pwd;
                model.name = name;
                //model.areas_id = areas_id;
                model.dwxz = dwxz;
                model.dwgm = dwgm;
                model.clnf = clnf;
                model.lxr = lxr;
                model.telephone = telephone;
                model.email = email;
                model.fax = fax;
                model.mobilephone = mobilephone;
                model.website = website;
                model.place = place;
                model.address = address;
                model.interviewadd = interviewadd;
                //model.about = about;
                model.isemp = isemp;
                model.ispub = ispub;
                model.lastlogin = lastlogin;
                model.logincount = logincount;
                //model.isshowlink = isshowlink;
                model.enterprise_mid = enterprise_mid;
                model.bcount = bcount;
                //model.membertime = membertime;
                model.issubsrciption = issubsrciption;
                model.status = status;
                model.areaname = areaname;
                model.tradename1 = tradename1;
                model.tradename2 = tradename2;
                model.tradename3 = tradename3;
                model.atid = atid;

                Session["enterprise_model"] = model;

                Response.Redirect("RegisterEnterpriseIntroduce.html");

            }
           
           

        }

      

       
      
    }
}